import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import('@/Layout'),
    children: [
      {
        path: '',
        component: () => import('@/views/Home'),
        meta: {
          sidebar: true
        }
      },
      {
        path: '/mv',
        component: () => import('@/views/MV'),
        meta: {
          sidebar: true,
          isShowPlayControl: true
        }
      },
      {
        path: '/information',
        component: () => import('@/views/Information'),
        meta: {
          sidebar: true
        }
      },
      {
        path: '/user',
        component: () => import('@/views/User'),
        meta: {
          sidebar: true
        }
      },
      {
        path: '/search',
        component: () => import('@/views/Search'),
        meta: {
          search: true
        }
      },
      {
        path: '/leaderboard',
        component: () => import('@/views/Leaderboard')
      },
      {
        path: '/login',
        component: () => import('@/views/Login'),
        meta: {
          title: '登录',
          tabbar: true,
          isShowPlayControl: true,
          search: true
        }
      },
      {
        path: '/reg',
        component: () => import('@/views/Reg'),
        meta: {
          title: '注册',
          tabbar: true,
          isShowPlayControl: true,
          search: true
        }
      },
      {
        path: '/conversation',
        component: () => import('@/views/Information/conversation.vue'),
        meta: {
          tabbar: true,
          isShowPlayControl: true
        }
      },
      {
        path: '/recommend:id',
        component: () => import('@/views/Home/components/RecommendMusicList'),
        meta: {
          search: true
        }
      },
      {
        path: '/allmv',
        component: () => import('@/views/MV/components/AllMv'),
        meta: {
          isShowPlayControl: true,
          title: '全部MV'
        }
      },
      {
        path: '/playmv/:mvid',
        component: () => import('@/views/MV/components/PlayMV'),
        meta: {
          tabbar: true,
          isShowPlayControl: true,
          search: true,
          title: ''
        }
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
